Generating Test Suites with Augmented Dynamic Symbolic Execution
نویسندگان
چکیده
Unit test generation tools typically aim at one of two objectives: to explore the program behavior in order to exercise automated oracles, or to produce a representative test set that can be used to manually add oracles or to use as a regression test set. Dynamic symbolic execution (DSE) can efficiently explore all simple paths through a program, exercising automated oracles such as assertions or code contracts. However, its original intention was not to produce representative test sets. Although DSE tools like Pex can retain subsets of the tests seen during the exploration, customer feedback revealed that users expect different values than those produced by Pex, and sometimes also more than one value for a given condition or program path. This threatens the applicability of DSE in a scenario without automated oracles. Indeed, even though all paths might be covered by DSE, the resulting tests are usually not sensitive enough to make a good regression test suite. In this paper, we present augmented dynamic symbolic execution, which aims to produce representative test sets with DSE by augmenting path conditions with additional conditions that enforce target criteria such as boundary or mutation adequacy, or logical coverage criteria. Experiments with our Apex prototype demonstrate that the resulting test cases can detect up to 30% more seeded defects than those produced with Pex.
منابع مشابه
Oasis: Concolic Execution Driven by Test Suites and Code Modifications
Testing remains an important aspect of checking software correctness. Manually constructed test suites are one option: they typically complete quickly, but they require human involvement in producing test cases, and their coverage may be limited. Recently, symbolic execution and concolic execution have been investigated as alternatives to test suites. These approaches require little manual inte...
متن کاملPrecise Guidance to Dynamic Test Generation
Dynamic symbolic execution has been shown an effective technique for automated test input generation. However, its scalability is limited due to the combinatorial explosion of the path space. We propose to take advantage of data flow analysis to better perform dynamic symbolic execution in the context of generating test inputs for maximum structural coverage. In particular, we utilize the chain...
متن کاملOptimising Test Execution Times in Test Suite Generation
In the last decade, enormous progress has been made in generating test cases for coverage criteria automatically via model checking. However, many approaches suffer from generating large test suites with long test execution times. In recent work, we developed a method to generate test suites from state-based design models with the shortest test execution time satisfying a given set of coverage ...
متن کاملGenerating Fixtures for JavaScript Unit Testing
In today’s web applications, JavaScript code interacts with the Document Object Model (DOM) at runtime. This runtime interaction between JavaScript and the DOM is errorprone and challenging to test. In order to unit test a JavaScript function that has read/write DOM operations, a DOM instance has to be provided as a test fixture. This DOM fixture needs to be in the exact structure expected by t...
متن کاملInfeasible path generalization in dynamic symbolic execution
Context: Automatic code-based test input generation aims at generating a test suite ensuring good code coverage. Dynamic Symbolic Execution (DSE) recently emerged as a strong code-based testing technique to increase coverage by solving path conditions with a combination of symbolic constraint solving and concrete executions. Objective: When selecting paths in DSE for generating test inputs, som...
متن کامل